package ym.ecrm.web.action.systemManagement;

import org.springframework.beans.factory.annotation.Autowired;

import com.opensymphony.xwork2.ModelDriven;

import ym.ecrm.core.common.exception.MessageException;
import ym.ecrm.core.dto.systemManagement.OrganizationDTO;
import ym.ecrm.core.service.systemManagement.ISystemService;
import ym.ecrm.web.action.base.BaseAction;

/**
 * 
 * @author Princess
 * 
 */
public class CreateOrganizationAction extends BaseAction implements ModelDriven<OrganizationDTO>{

	private OrganizationDTO organizationDTO = new OrganizationDTO();
	
	@Autowired
	private ISystemService systemService;
	public String execute() {
		try {
			systemService.createOrganization(organizationDTO);
		} catch (MessageException e) {
			return processException(e);
		}
		return proccess();
	}
	
	public String getErrorMessage() {
		return errorMessage;
	}

	public String getSuccess() {
		return success;
	}

	@Override
	public OrganizationDTO getModel() {
		return organizationDTO;
	}
}
